unit frmSetting;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IniFiles, uHHUtils, ExtCtrls, RzPanel, ComCtrls, uLangConst,
  uDelphiBaseForm, uWorkbench;

type
  TSettingForm = class(TDelphiBaseForm)
    btnOK: TButton;
    btnCancel: TButton;
    PageControl1: TPageControl;
    tsSystemParam: TTabSheet;
    GroupBox2: TGroupBox;
    lblSavePath: TLabel;
    edtSavePath: TEdit;
    btnPath: TButton;
    GroupBox1: TGroupBox;
    lblHost: TLabel;
    edtHost: TEdit;
    chkPGMMute: TCheckBox;
    grpHotKey: TGroupBox;
    lblStartRecord: TLabel;
    lblStopRec: TLabel;
    hkStartRecord: THotKey;
    hkStopRecord: THotKey;
    TabSheet1: TTabSheet;
    GroupBox3: TGroupBox;
    lblPTUserName: TLabel;
    Label2: TLabel;
    Label1: TLabel;
    edtPTUserName: TEdit;
    edtPTHost: TEdit;
    edtPTPort: TEdit;
    tsNetSetting: TTabSheet;
    lblRtmp1: TLabel;
    lblRtmp2: TLabel;
    edtRtmp1: TEdit;
    edtRtmp2: TEdit;
    lblIP: TLabel;
    lblMask: TLabel;
    Label3: TLabel;
    lblDNS1: TLabel;
    lblRtsp: TLabel;
    chkRtsp: TCheckBox;
    edtIP: TEdit;
    edtMask: TEdit;
    edtGetway: TEdit;
    edtDNS1: TEdit;
    tsSystemSetting: TTabSheet;
    grpVideoLive: TGroupBox;
    lblVideoLiveBitrate: TLabel;
    lblVideoLiveProfile: TLabel;
    edtVideoLiveBitrate: TEdit;
    cbbVideoLiveResolution: TComboBox;
    lblVideoLiveResolution: TLabel;
    cbbVideoLiveProfile: TComboBox;
    grpAudioLive: TGroupBox;
    lblAudioLiveBitrate: TLabel;
    edtAudioLiveBitrate: TEdit;
    Edit1: TEdit;
    Label7: TLabel;
    btnExportSetting: TButton;
    btnImportSetting: TButton;
    lblMac: TLabel;
    edtMac: TEdit;
    btnSaveNetSetting: TButton;
    btnSaveSystemSetting: TButton;
    tsActiveSetting: TTabSheet;
    lblActive1: TLabel;
    lblActive2: TLabel;
    lblActive3: TLabel;
    lblActive4: TLabel;
    edtActive1: TEdit;
    edtActive2: TEdit;
    edtActive3: TEdit;
    edtActive4: TEdit;
    tsControlSetting: TTabSheet;
    lblTeacher: TLabel;
    lblStudent: TLabel;
    lblOther: TLabel;
    edtTeacherSP: TEdit;
    edtStudentSP: TEdit;
    edtOtherSP: TEdit;
    lblTeacherSPBitrate: TLabel;
    edtTeacherSPBitrate: TEdit;
    edtStudentSPBitrate: TEdit;
    lblStudentSPBitrate: TLabel;
    edtOtherSPBitrate: TEdit;
    lblOtherSPBitrate: TLabel;
    lblTeacherSPAddr: TLabel;
    edtTeacherSPAddr: TEdit;
    lblStudentSPAddr: TLabel;
    edtStudentSPAddr: TEdit;
    edtOtherSPAddr: TEdit;
    lblOtherSPAddr: TLabel;
    lblNetTeacherIP: TLabel;
    edtNetTeacherIP: TEdit;
    edtNetTeacherPort: TEdit;
    edtNetTeacherAddr: TEdit;
    lblNetTeacherPort: TLabel;
    lblNetTeacherAddr: TLabel;
    lblNetStudentIP: TLabel;
    edtNetStudentIP: TEdit;
    lblNetStudentPort: TLabel;
    edtNetStudentPort: TEdit;
    lblNetStudentAddr: TLabel;
    edtNetStudentAddr: TEdit;
    rbUseSerialPort: TRadioButton;
    rbUseUDP: TRadioButton;
    btnSaveSerial: TButton;
    rbMaster: TRadioButton;
    rbClient: TRadioButton;
    chk1: TCheckBox;
    tsVI: TTabSheet;
    GroupBox4: TGroupBox;
    Label4: TLabel;
    Label6: TLabel;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    grpVi: TGroupBox;
    lblViResolution: TLabel;
    lblViMode: TLabel;
    cbbResolution: TComboBox;
    ComboBox3: TComboBox;
    GroupBox5: TGroupBox;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Edit2: TEdit;
    ComboBox4: TComboBox;
    ComboBox5: TComboBox;
    Button1: TButton;
    Label11: TLabel;
    Edit3: TEdit;
    Label12: TLabel;
    Edit4: TEdit;
    GroupBox6: TGroupBox;
    lblAudioLiveSampleRate: TLabel;
    cbbAudioLiveSampleRate: TComboBox;
    Label13: TLabel;
    ComboBox6: TComboBox;
    procedure btnPathClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    FHost: string;
    FWorkbench: IMMWorkbench;
  public
    procedure ChangeLanguage(ALanguageIniFile: string); override;
    procedure SetWorkbench(AWorkbench: IMMWorkbench);
  end;

var
  SettingForm: TSettingForm;

implementation

{$R *.dfm}

procedure TSettingForm.btnPathClick(Sender: TObject);
var
  Dir: string;
begin
  Dir := BrowseDir(Handle, LC_GENERAL_SAVE_PATH, edtSavePath.Text);
  if Length(Dir) > 0 then
  begin
    if Dir[Length(Dir)] <> '\' then
      Dir := Dir + '\';
    edtSavePath.Text := Dir;
    edtSavePath.Hint := edtSavePath.Text;
    edtSavePath.ShowHint := True;
  end;
  Self.BringToFront;
end;

procedure TSettingForm.ChangeLanguage(ALanguageIniFile: string);
begin
  inherited ChangeLanguage(ALanguageIniFile);
end;

procedure TSettingForm.FormCreate(Sender: TObject);
begin
  TranslateConsts(getLanguageFileName());
  ChangeLanguage(getLanguageFileName());
  if 'all' <> ParamStr(1) then
  begin
    TabSheet1.Visible := False;
    TabSheet1.Enabled := False;
    PageControl1.RemoveControl(TabSheet1);
  end;
end;

procedure TSettingForm.SetWorkbench(AWorkbench: IMMWorkbench);
begin

end;

end.
